<script type="text/javascript">
    $.CurrentNavtab.find("#large_type").on("change", function() {
        var typeId = $(this).val();
        $.post("{:U('Admin/Type/getChildType')}", {"typeId":typeId}, function(res) {
            var opt = "<option value='0'>请选择</option>";
            if(res["statusCode"] == 200) {
                var list = res["data"]["list"];
                for(var ix = 0; ix < list.length; ++ix) {
                    opt += "<option value='" + list[ix]["id"] + "'>" + list[ix]["name"] + "</option>";
                }
            }
            $.CurrentNavtab.find("#small_type").html(opt);
        }, "json");
    });
</script>
<div class="bjui-pageContent">
    <form action="{:U('Admin/Attr/addAttr')}" data-toggle="validate" data-alertmsg="false">
        <table class="table table-condensed table-hover" width="100%">
            <tbody>
                <tr>
                    <td>
                        <label for="name" class="control-label x85">属性名称：</label>
                        <input type="text" name="name" id="name" value="" data-rule="required" size="20">
                    </td>
                </tr>
                <tr>
                    <td>
                        <label for="large_type" class="control-label x85">苗木分类：</label>
                        <select name="large_type" id="large_type" class="form-control" style="width:200px;">
                            <option value="0">请选择</option>
                            <notempty name="largeType">
                                <foreach name="largeType" item="vo" key="k">
                                    <option value="{$vo.id}">{$vo.name}</option>
                                </foreach>
                            </notempty>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td>
                        <label for="small_type" class="control-label x85">苗木种类：</label>
                        <select name="small_type" id="small_type" class="form-control" style="width:200px;">
                            <option value="0">请选择</option>
                        </select>
                    </td>
                </tr>
                <tr>
                    <td>
                        <label for="attr_type" class="control-label x85">属性类型：</label>
                        <notempty name="treeAttrType">
                            <foreach name="treeAttrType" item="vo" key="k">
                                <input type="radio" name="attr_type" data-toggle="icheck" value="{$k}" data-label="{$vo}" <if condition="$k eq 1">checked="checked"</if>>
                                &nbsp;&nbsp;
                            </foreach>
                        </notempty>
                    </td>
                </tr>
                <tr>
                    <td>
                        <label for="value" class="control-label x85">属性值：</label>
                        <input type="text" name="value" id="value" value="" size="20">
                        <span>(属性类型为文本可以不填,其他类型值之间逗号分割,例如:10,20,30)</span>
                    </td>
                </tr>
                <tr>
                    <td>
                        <label for="unit" class="control-label x85">单位：</label>
                        <input type="text" name="unit" id="unit" value="" size="20">
                        <span>(例如:cm)</span>
                    </td>
                </tr>
            </tbody>
        </table>
    </form>
</div>
<div class="bjui-pageFooter">
    <ul>
        <li><button type="button" class="btn-close" data-icon="close">取消</button></li>
        <li><button type="submit" class="btn-default" data-icon="save">添加</button></li>
    </ul>
</div>